#include <stdio.h>

//求两个数的较大值

//法一.使用选择语句

int main()
{
	int a = 5;
	int b = 7;
	if (a > b)
		printf("较大值是%d\n", a);
	else
		printf("较大值是%d\n", b);
	return 0;
}

//法二.定义一个函数

int max(int x, int y)
{
	if (x < y)
		return y;
	else
		return x;
}
int main()
{
	int a = 5;
	int b = 7;
	int Max = 0;
	Max = max(a, b);
	printf("较大值是%d\n", Max);
	return 0;
}